/***
 * @description axios封装
 * @file api.ts
 * @author andy
 * @date 2024/3/22 16:40
 */
// file:api.s
// 1、导入axios以及拦截器
import service from "./request";

// demo接口1
export const demo1 = (data: any) => {
  return service({
    url: "/user/user/demo1/" + data,
    method: "post",
  });
};

// demo接口2
export const demo2 = (data: any) => {
  return service({
    url: "/user/user/demo2",
    method: "post",
    data,
  });
};

// 发送验证码
export const sendCode = (mobile: any) => {
  return service({
    url: "/auth/index/sendCode/" + mobile,
    method: "post",
  });
};

// 注册用户
export const regUser = (data: any) => {
  return service({
    url: "/auth/index/regUser",
    method: "post",
    data,
  });
};

// 登录
export const login = (data: any) => {
  return service({
    url: "/auth/index/login",
    method: "post",
    data,
  });
};

// 获取权限列表
export const getMenuTree = () => {
  return service({
    url: "/auth/index/getMenuTree",
    method: "post",
  });
};

// 获取品牌列表
export const getBrandList = (data: any) => {
  return service({
    url: "/prod/brand/getBrandList",
    method: "post",
    data,
  });
};

// 添加品牌
export const addBrand = (data: any) => {
  return service({
    url: "/prod/brand/addBrand",
    method: "post",
    data,
  });
};

// 更改品牌状态
export const changeBrandStatus = (data: any) => {
  return service({
    url: "/prod/brand/changeBrandStatus",
    method: "post",
    data,
  });
};

// 获取商品分类列表
export const getTypeList = (data: any) => {
  return service({
    url: "/prod/type/getTypeList",
    method: "post",
    data,
  });
};

// 添加商品分类
export const addType = (data: any) => {
  return service({
    url: "/prod/type/addType",
    method: "post",
    data,
  });
};

// 获取商品分页列表
export const getProdList = (data: any) => {
  return service({
    url: "/prod/index/getProdList",
    method: "post",
    data,
  });
};

// 批量删除商品
export const deleteBatch = (data: any) => {
  return service({
    url: "/prod/index/deleteBatch",
    method: "post",
    data,
  });
};

// 单删商品
export const deleteProd = (prodId: any) => {
  return service({
    url: "/prod/index/deleteProd/" + prodId,
    method: "post",
  });
};

// 获取商品分类列表数据
export const getTypeInfo = () => {
  return service({
    url: "/prod/index/getTypeInfo",
    method: "post",
  });
};

// 获取字典表数据
export const getDictList = (typeId: any) => {
  return service({
    url: "/prod/index/getDictList/" + typeId,
    method: "post",
  });
};

// 添加商品
export const addProd = (data: any) => {
  return service({
    url: "/prod/index/addProd",
    method: "post",
    data,
  });
};

// 添加商品附件
export const addProdAtta = (data: any) => {
  return service({
    url: "/prod/index/addProdAtta",
    method: "post",
    data,
  });
};

// 获取订单列表
export const getOrderList = (data: any) => {
  return service({
    url: "/prod/order/getOrderList",
    method: "post",
    data,
  });
};

// 批量删除订单
export const deleteBatchOrder = (data: any) => {
  return service({
    url: "/prod/order/deleteBatchOrder",
    method: "post",
    data,
  });
};

// 获取商品信息列表
export const getProdInfoList = () => {
  return service({
    url: "/prod/index/getProdInfoList",
    method: "post",
  });
};

// 添加订单
export const addOrder = (data: any) => {
  return service({
    url: "/prod/order/addOrder",
    method: "post",
    data,
  });
};

// 根据Id，获取订单信息
export const getOrderInfoById = (orderId: any) => {
  return service({
    url: "/prod/order/getOrderInfoById/" + orderId,
    method: "post",
  });
};

// 获取商品信息分页列表
export const getProdInfoPage = (data: any) => {
  return service({
    url: "/prod/index/getProdInfoPage",
    method: "post",
    data,
  });
};

// 添加商品信息
export const addProdInfo = (data: any) => {
  return service({
    url: "/prod/index/addProdInfo",
    method: "post",
    data,
  });
};

// 获取拼团活动分页列表
export const getGroupActivePage = (data: any) => {
  return service({
    url: "/team/index/getGroupActivePage",
    method: "post",
    data,
  });
};

// 添加拼团活动
export const addGroupActive = (data: any) => {
  return service({
    url: "/team/index/addGroupActive",
    method: "post",
    data,
  });
};

// 修改拼团活动信息
export const updateGroupActive = (data: any) => {
  return service({
    url: "/team/index/updateGroupActive",
    method: "post",
    data,
  });
};

// 根据ID删除拼团活动
export const deleteGroupActive = (activeId: any) => {
  return service({
    url: "/team/index/deleteGroupActive/" + activeId,
    method: "post",
  });
};

// 获取商家拼团活动分页列表
export const getGroupJoinPage = (data: any) => {
  return service({
    url: "/team/join/getGroupJoinPage",
    method: "post",
    data,
  });
};

// 添加商家拼团活动
export const addGroupJoin = (data: any) => {
  return service({
    url: "/team/join/addGroupJoin",
    method: "post",
    data,
  });
};

// 修改商家拼团活动信息
export const updateGroupJoin = (data: any) => {
  return service({
    url: "/team/join/updateGroupJoin",
    method: "post",
    data,
  });
};

// 根据ID删除商家拼团活动
export const deleteGroupJoin = (joinId: any) => {
  return service({
    url: "/team/join/deleteGroupJoin/" + joinId,
    method: "post",
  });
};

// 获取参与拼团列表
export const getGroupList = (data: any) => {
  return service({
    url: "/team/group/getGroupList",
    method: "post",
    data,
  });
};

// 修改商家拼团活动信息
export const getMyOrderList = () => {
  return service({
    url: "/team/group/getMyOrderList",
    method: "post",
  });
};

// 根据ID删除商家拼团活动
export const deleteOrder = (data: any) => {
  return service({
    url: "/team/group/deleteOrder",
    method: "post",
    data,
  });
};

// 获取抽奖活动列表
export const getActiveList = (data: any) => {
  return service({
    url: "/win/index/getActiveList",
    method: "post",
    data,
  });
};

// 添加抽奖活动
export const addActive = (data: any) => {
  return service({
    url: "/win/index/addActive",
    method: "post",
    data,
  });
};

// 修改抽奖活动信息
export const updateActive = (data: any) => {
  return service({
    url: "/win/index/updateActive",
    method: "post",
    data,
  });
};

// 根据ID删除抽奖活动
export const deleteActive = (activeId: any) => {
  return service({
    url: "/win/index/deleteActive/" + activeId,
    method: "post",
  });
};

// 获取规则列表数据
export const getActiveRuleList = (activeId: any) => {
  return service({
    url: "/win/index/getActiveRuleList/" + activeId,
    method: "post",
  });
};
